home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act6a / 00398_checkit.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  3.2 KB  |  126 lines

  1. on checkit
  2.   global partnum, changer, TRIAL, partlist, takeinput, rumproast, firstcursor, TxtCursor, remember
  3.   set golem to getAt(partlist, partnum)
  4.   set takeinput to 0
  5.   if changer = golem then
  6.     victory()
  7.   else
  8.     puppetSound(0)
  9.     set remember to the castNum of sprite 3
  10.     switch(11, 3)
  11.     puppetSprite(3, 0)
  12.     set changer to EMPTY
  13.     set TxtCursor to 21 + ((partnum - 1) * 2)
  14.     set the castNum of sprite (21 + ((partnum - 1) * 2)) to firstcursor
  15.     set the castNum of sprite (22 + ((partnum - 1) * 2)) to the number of cast "digit_"
  16.     set TRIAL to TRIAL + 1
  17.     if TRIAL = 1 then
  18.       play frame "hint1"
  19.     else
  20.       play frame "hint2"
  21.     end if
  22.     puppetSprite(11, 0)
  23.     go(rumproast)
  24.   end if
  25. end
  26.  
  27. on switch snew, sold
  28.   sactivate(snew, sinfo(sold))
  29. end
  30.  
  31. on sinfo snew
  32.   set stuff to []
  33.   add(stuff, the castNum of sprite snew)
  34.   add(stuff, the locH of sprite snew)
  35.   add(stuff, the locV of sprite snew)
  36.   add(stuff, the blend of sprite snew)
  37.   add(stuff, the foreColor of sprite snew)
  38.   add(stuff, the ink of sprite snew)
  39.   add(stuff, the type of sprite snew)
  40.   return stuff
  41. end
  42.  
  43. on sactivate snew, stuff
  44.   puppetSprite(snew, 1)
  45.   set the castNum of sprite snew to getAt(stuff, 1)
  46.   set the locH of sprite snew to getAt(stuff, 2)
  47.   set the locV of sprite snew to getAt(stuff, 3)
  48.   set the blend of sprite snew to getAt(stuff, 4)
  49.   set the foreColor of sprite snew to getAt(stuff, 5)
  50.   set the ink of sprite snew to getAt(stuff, 6)
  51.   set the type of sprite snew to getAt(stuff, 7)
  52. end
  53.  
  54. on blinkwrong
  55.   global partlist, partnum
  56.   startTimer()
  57.   repeat while the timer < 120
  58.     set the foreColor of sprite getPropAt(partlist, partnum) to 0
  59.     updateStage()
  60.     mydelay(10)
  61.     set the foreColor of sprite getPropAt(partlist, partnum) to 255
  62.     updateStage()
  63.     mydelay(10)
  64.   end repeat
  65. end
  66.  
  67. on mydelay dtime
  68.   set stime to the timer
  69.   repeat while the timer < (stime + dtime)
  70.     updateStage()
  71.   end repeat
  72. end
  73.  
  74. on startMovie
  75.   global castnumber, firstcursor, takeinput, lastcursor
  76.   set takeinput to 0
  77.   set firstcursor to the number of cast "firstcursor"
  78.   set lastcursor to the number of cast "lastcursor"
  79.   set castnumber to []
  80.   repeat with xxx = 0 to 9
  81.     add(castnumber, the number of cast ("digit" & xxx))
  82.   end repeat
  83.   add(castnumber, the number of cast "ones")
  84.   add(castnumber, the number of cast "digit_")
  85.   repeat with xxx = 1 to 48
  86.     set the visible of sprite xxx to 1
  87.   end repeat
  88. end
  89.  
  90. on stopMovie
  91.   repeat with xxx = 1 to 48
  92.     set the visible of sprite xxx to 1
  93.   end repeat
  94. end
  95.  
  96. on victory
  97.   global partnum, chib, changer, TRIAL, bugeyesx, bugeyesy, lastrand
  98.   set TRIAL to 0
  99.   set changer to EMPTY
  100.   set partnum to partnum + 1
  101.   if partnum > 6 then
  102.     puppetSound(0)
  103.     repeat with xxy = 3 to 10
  104.       puppetSprite(xxy, 1)
  105.     end repeat
  106.     puppetSprite(19, 1)
  107.     set the locH of sprite 19 to bugeyesx - 7
  108.     updateStage()
  109.     set thisrand to random(6)
  110.     repeat while lastrand = thisrand
  111.       set thisrand to random(6)
  112.     end repeat
  113.     play frame "reward" & thisrand
  114.     set lastrand to thisrand
  115.     repeat with xxy = 3 to 10
  116.       puppetSprite(xxy, 0)
  117.     end repeat
  118.     puppetSprite(19, 0)
  119.     go("start")
  120.   else
  121.     puppetSound("correct" & random(4))
  122.     updateStage()
  123.     go("bugs" & chib)
  124.   end if
  125. end
  126.